package cn.lj.base.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class AjaxResult {
    private boolean success = true;
    private String msg = "操作成功";
    private Object data;/*返回的数据*/
    /*执行成功返回默认对象*/


    public static AjaxResult me(){
        return new AjaxResult();
    }
    /*如果执行失败，设置操作失败*/
    public AjaxResult setAjaxResult(String msg){
        this.success = false;
        this.msg = msg;
        return this;
    }
    /*设置返回的数据*/
    public AjaxResult setData(Object data){
        this.data =data;
        return this;
    }
}
